home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 July: Mac OS SDK / Dev.CD Jul 97 SDK1.toast / Development Kits (Disc 1) / Interfaces&Libraries / Interfaces / CIncludes / Telephones.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-09-06  |  47.0 KB  |  971 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        Telephones.h
  3.  
  4.      Contains:    Interface to the Telephone Manager
  5.  
  6.      Version:    
  7.  
  8.      DRI:        Samir Dharia
  9.  
  10.      Copyright:    © 1984-1994 by Apple Computer, Inc.
  11.                  All rights reserved.
  12.  
  13.      Warning:    *** APPLE INTERNAL USE ONLY ***
  14.                  This file may contain unreleased API's
  15.  
  16.      BuildInfo:    Built by:            Sue Kuo
  17.                  With Interfacer:    1.1d11  
  18.                  From:                Telephones.i
  19.                      Revision:        17
  20.                      Dated:            12/13/94
  21.                      Last change by:    ngk
  22.                      Last comment:    <Really SRD> Add telUnknown and telTerminalHWDisconnected
  23.  
  24.      Bugs:        Report bugs to Radar component “System Interfaces”, “Latest”
  25.                  List the version information (from above) in the Problem Description.
  26.  
  27. */
  28.  
  29. #ifndef __TELEPHONES__
  30. #define __TELEPHONES__
  31.  
  32.  
  33. #ifndef __TYPES__
  34. #include <Types.h>
  35. #endif
  36. /*    #include <ConditionalMacros.h>                                */
  37.  
  38. #ifndef __WINDOWS__
  39. #include <Windows.h>
  40. #endif
  41. /*    #include <Memory.h>                                            */
  42. /*        #include <MixedMode.h>                                    */
  43. /*    #include <Quickdraw.h>                                        */
  44. /*        #include <QuickdrawText.h>                                */
  45. /*    #include <Events.h>                                            */
  46. /*        #include <OSUtils.h>                                    */
  47. /*    #include <Controls.h>                                        */
  48. /*        #include <Collections.h>                                */
  49. /*        #include <Appearance.h>                                    */
  50. /*            #include <Files.h>                                    */
  51. /*        #include <Menus.h>                                        */
  52. /*            #include <TextObjects.h>                            */
  53. /*                #include <Unicode.h>                            */
  54. /*    #include <AppleEvents.h>                                    */
  55. /*        #include <Errors.h>                                        */
  56. /*        #include <EPPC.h>                                        */
  57. /*            #include <AppleTalk.h>                                */
  58. /*            #include <PPCToolbox.h>                                */
  59. /*            #include <Processes.h>                                */
  60. /*        #include <Notification.h>                                */
  61. /*            #include <Kernel.h>                                    */
  62. /*                #include <MachineExceptions.h>                    */
  63. /*                #include <Timing.h>                                */
  64. /*    #include <Drag.h>                                            */
  65. /*        #include <TextEdit.h>                                    */
  66.  
  67. #ifndef __DIALOGS__
  68. #include <Dialogs.h>
  69. #endif
  70.  
  71. #ifndef __CTBUTILITIES__
  72. #include <CTBUtilities.h>
  73. #endif
  74. /*    #include <StandardFile.h>                                    */
  75.  
  76. #ifndef __COMPONENTS__
  77. #include <Components.h>
  78. #endif
  79.  
  80. #ifdef __cplusplus
  81. extern "C" {
  82. #endif
  83.  
  84. #if GENERATINGPOWERPC
  85. #pragma options align=mac68k
  86. #endif
  87.  
  88. #ifdef __CFM68K__
  89. #pragma import on
  90. #endif
  91.  
  92. #ifndef classTEL
  93.  
  94. enum {
  95. /* telephone tool file type */
  96.     classTEL                    = 'vbnd'
  97. };
  98.  
  99. #endif
  100.  
  101. enum {
  102. /*    curTELVersion = 4,                        not supported. Use TELGetTELVersion to get the
  103.                                             current version of the Telephone Manager */
  104.     telChooseDisaster            = chooseDisaster,
  105.     telChooseFailed                = chooseFailed,
  106.     telChooseAborted            = chooseAborted,
  107.     telChooseOKMinor            = chooseOKMinor,
  108.     telChooseOKMajor            = chooseOKMajor,
  109.     telChooseCancel                = chooseCancel,
  110. /*    the chooseXXX symbols are defined in CTBUtilities.(pah) */
  111.     telChooseOKTermChanged        = 4
  112. };
  113.  
  114. enum {
  115. /* PHYSICAL TERMINAL CONSTANTS 
  116.  
  117. * INDEPENDENT HANDSET CONSTANTS */
  118.     telIndHSOnHook                = 0,                            /* independent handset on hook */
  119.     telIndHSOffHook                = 1,                            /* independent handset off hook */
  120.     telIndHSDisconnected        = 0,                            /* handset disconnected from the line */
  121.     telIndHSConnected            = 1,                            /* handset connected to the line */
  122. /* HOOK STATE CONSTANTS */
  123.     telHandset                    = 1,                            /* handset hookswitch */
  124.     telSpeakerphone                = 2,                            /* speakerphone 'on' switch */
  125.     telDeviceOffHook            = 1,                            /* device off hook */
  126.     telDeviceOnHook                = 0,                            /* device on hook */
  127. /* VOLUME CONTROL CONSTANTS */
  128.     telHandsetSpeakerVol        = 1,                            /* volume of the handset speaker */
  129.     telHandsetMicVol            = 2,                            /* sensitivity of the handset mic */
  130.     telSpeakerphoneVol            = 3,                            /* speakerphone volume */
  131.     telSpeakerphoneMicVol        = 4,                            /* sensitivity of the spkrphone mic */
  132.     telRingerVol                = 5,                            /* volume of the ringer */
  133.     telBuiltinSPVol                = 6,                            /* volume of the built-in speakerphone */
  134.     telBuiltinSPMicVol            = 7,                            /* sensitivity of the built-in speakerphone mic */
  135.     telVolSame                    = 0,                            /* leaves the volume at previous level */
  136.     telVolMin                    = 1,                            /* turns volume down to minimum level, but not off */
  137.     telVolMax                    = 100,                            /* highest level allowed by the Telephone Manager */
  138.     telVolStateSame                = 0,                            /* leaves device in same state */
  139.     telVolStateOff                = 1,                            /* turns the device off , 
  140.                                  * but doesn't change the volume setting. 
  141.                                  * Use for mute functions. */
  142.     telVolStateOn                = 2,                            /* turns the device on.  Volume setting is 
  143.                                  * the same as previously set.*/
  144. /* DISPLAY CONSTANTS */
  145.     telNormalDisplayMode        = 1,                            /* normal display mode */
  146.     telInspectMode                = 2,                            /* inspect display mode */
  147.     telMiscMode                    = 3,                            /* miscellaneous display mode */
  148.     telRetrieveMode                = 4,                            /* message retrieval mode */
  149.     telDirectoryQueryMode        = 5,                            /* electronic directory mode */
  150.     telEntireDisplay            = 0,                            /* entire Display */
  151. /* KEY PRESS CONSTANTS */
  152.     telHangupKey                = 1,                            /* drop, or release, key pressed */
  153.     telHoldKey                    = 2,                            /* hold key pressed */
  154.     telConferenceKey            = 3,                            /* conference key pressed */
  155.     telTransferKey                = 4,                            /* transfer key pressed */
  156.     telForwardKey                = 5,                            /* call forward key pressed */
  157.     telCallbackKey                = 6,                            /* call back key pressed */
  158.     telDNDKey                    = 7,                            /* do not disturb key pressed */
  159.     telCallPickupKey            = 8,                            /* call Pickup key pressed */
  160.     telCallParkKey                = 9,                            /* call Park key pressed */
  161.     telCallDeflectKey            = 10,                            /* call Deflect key pressed */
  162.     telVoiceMailAccessKey        = 11,                            /* voice Mail Access key pressed */
  163.     telCallRejectKey            = 12,                            /* call Reject key pressed */
  164.     telOtherKey                    = 16,                            /* other key pressed */
  165.     telKeyPadPress                = 1,                            /* key pressed on 12 digit keypad*/
  166.     telFeatureKeyPress            = 2,                            /* feature Key Pressed */
  167.     telTerminalEnabled            = 0,
  168.     telTerminalDisabled            = 1,
  169.     telUnknown                    = 0,                            /* unknown error */
  170.     telTerminalHWDisconnected    = 1,                            /* terminal hardware is disconnected */
  171.     telDeviceDriverClosed        = 2,                            /* device driver is closed */
  172. /* ALERT PATTERN */
  173.     telPattern0                    = 0,
  174.     telPattern1                    = 1,
  175.     telPattern2                    = 2,
  176.     telPattern3                    = 3,
  177.     telPattern4                    = 4,
  178.     telPattern5                    = 5,
  179.     telPattern6                    = 6,
  180.     telPattern7                    = 7,
  181.     telPatternOff                = 8,
  182.     telPatternUndefined            = 15,
  183. /* DN TYPES */
  184.     telAllDNs                    = 0,                            /* counts all types of DNs */
  185.     telInternalDNs                = 1,                            /* connected to PBX or other non-public switch */
  186.     telInternalDNsOnly            = 2,                            /* connected to PBX or other non-public switch 
  187.                                  * and able to place internal calls only */
  188.     telExternalDNs                = 3,                            /* connected to public network */
  189.     telDNTypeUnknown            = 4,                            /* DN type unknown */
  190. /* DN USAGE */
  191.     telDNNotUsed                = 0,                            /* DN is not used - onhook */
  192.     telDNPOTSCall                = 1,                            /* DN used for POTs call */
  193.     telDNFaxCall                = 2,                            /* DN used for fax call */
  194.     telDNDataCall                = 3,                            /* DN used for data call */
  195.     telDNAlerting                = 4,                            /* Incoming call at DN */
  196.     telDNUnknownState            = 5,                            /* DN is in unknown state */
  197. /* CALL FORWARDING TYPES */
  198.     telForwardImmediate            = 1,                            /* immediately forward calls */
  199.     telForwardBusy                = 2,                            /* forward on Busy */
  200.     telForwardNoAnswer            = 3,                            /* forward on No answer */
  201.     telForwardBusyNA            = 4,                            /* forwarding for busy and no answer*/
  202.     telForwardTypeUnknown        = 5,                            /* type of forwarding is unknown */
  203. /* CALL FORWARDING MESSAGES */
  204.     telForwardCleared            = 0,                            /* forwarding has been cleared */
  205.     telForwardEst                = 1,                            /* forwarding has been established*/
  206.     telForwardFailed            = 2,                            /* attempt to setup forwarding has failed*/
  207. /* DO NOT DISTURB TYPES */
  208.     telDNDIntExt                = 0,                            /* do not disturb for all internal and external calls*/
  209.     telDNDExternal                = 1,                            /* do not disturb for external calls only */
  210.     telDNDInternal                = 2,                            /* do not disturb for internal calls only */
  211.     telDNDNonIntercom            = 3,                            /* do not disturb for all calls except intercom */
  212. /* DO NOT DISTURB MESSAGES */
  213.     telDNDCleared                = 0,                            /* do not disturb has been cleared */
  214.     telDNDEst                    = 1,                            /* do not disturb has been established */
  215.     telDNDFailed                = 2,                            /* attempt to setup do not disturb has failed */
  216. /* VOICE MAIL MESSAGES */
  217.     telAllVoiceMessagesRead        = 0,                            /* all messages have been read, none are  waiting 
  218.                                  * to be read */
  219.     telNewVoiceMessage            = 1,                            /* a new message has arrived or messages are waiting 
  220.                                  * for this DN */
  221. /* DNSELECT MESSAGE */
  222.     telDNDeselected                = 0,                            /* DN has been deselected */
  223.     telDNSelected                = 1,                            /* DN has been selected */
  224. /* CALL ORIGINATORS */
  225.     telInternalCall                = 0,                            /* return nth internal CA */
  226.     telExternalCall                = 1,                            /* return nth external CA */
  227.     telUnknownCallOrigin        = 2,                            /* unknown call type */
  228.     telAllCallOrigins            = 2,                            /* return nth CA internal or external */
  229. /* CALL TYPES */
  230.     telVoiceMailAccessOut        = (-7),
  231.     telPageOut                    = (-6),
  232.     telIntercomOut                = (-5),
  233.     telCallbackOut                = (-4),
  234.     telPickup                    = (-3),
  235.     telParkRetrieve                = (-2),
  236.     telNormalOut                = (-1),
  237.     telUnknownCallType            = 0,
  238.     telNormalIn                    = 1,
  239.     telForwardedImmediate        = 2,
  240.     telForwardedBusy            = 3,
  241.     telForwardedNoAnswer        = 4,
  242.     telTransfer                    = 5,
  243.     telDeflected                = 6,
  244.     telIntercepted                = 7,
  245.     telDeflectRecall            = 8,
  246.     telParkRecall                = 9,
  247.     telTransferredRecall        = 10,
  248.     telIntercomIn                = 11,
  249.     telCallbackIn                = 12,
  250. /* DIAL TYPES */
  251.     telDNDialable                = 0,                            /* this DN could be dialed via TELSetupCall */
  252.     telDNNorthAmerican            = 1,                            /* rmtDN is standard North America 10 digit number */
  253.     telDNInternational            = 2,                            /* rmtDN is an international number */
  254.     telDNAlmostDialable            = 3,                            /* rmtDN is almost dialable, */
  255. /* missing prefix such as 9 or 1 */
  256.     telDNUnknown                = 15,                            /* unknown whether DN is dialable */
  257. /* CALL PROGRESS MESSAGES */
  258.     telCAPDialTone                = 1,                            /* dial tone */
  259.     telCAPRinging                = 2,                            /* destination CA is alerting */
  260.     telCAPDialing                = 3,                            /* dialing the other end */
  261.     telCAPReorder                = 4,                            /* reorder */
  262.     telCAPBusy                    = 5,                            /* busy */
  263.     telCAPRouted                = 6,                            /* call routed; rmtDN will hold the routing directory */
  264. /* number routeDN and routePartyName have been updated */
  265.     telCAPRoutedOff                = 7,                            /* call routed off-network; no further progress will */
  266. /* be available */
  267.     telCAPTimeout                = 8,                            /* call timed out */
  268.     telCAPUpdate                = 9,                            /* name and rmtDN information has been updated */
  269.     telCAPPrompt                = 10,                            /* the network is prompting for more information */
  270.     telCAPWaiting                = 11,                            /* call is proceeding, but there is no response yet */
  271. /* from the destination */
  272.     telCAPCPC                    = 12,                            /* telephone tool detected CPC signal */
  273.     telCAPNoDialTone            = 13,                            /* dial tone not detected */
  274.     telCAPUnknown                = 15,                            /* call progress state unknown */
  275.     telCAPDialDisabled            = 16,                            /* Blacklisting: Dial Disabled */
  276.     telCAPBlacklistedNumber        = 17,                            /* Blacklisting: Blacklisted Number */
  277.     telCAPForbiddenNumber        = 18,                            /* Blacklisting: Forbidden Number */
  278.     telCAPModemGuardTime        = 19,                            /* Modem Guard Timein force, unable to dial */
  279.     telCAPLCDetected            = 20,                            /* trying to dial a number while the handset is offhook */
  280.     telCAPLostLC                = 21,                            /* trying manual dial or answer while handset not off hook 
  281.                                      * or also lost line current during dialing. */
  282. /* OUTGOING CALL MESSAGES */
  283.     telPhysical                    = 0,                            /* user lifted handset and initiated call */
  284.     telProgrammatic                = 1,                            /* programmatic initiation of outgoing call */
  285. /* DISCONNECT MESSAGES */
  286.     telLocalDisconnect            = 0,                            /* local party, this user, responsible for disconnect */
  287.     telRemoteDisconnect            = 1,                            /* remote party responsible for disconnect */
  288. /* DISCONNECT TYPES */
  289.     telCADNormal                = 1,                            /* normal disconnect */
  290.     telCADBusy                    = 2,                            /* remote user busy */
  291.     telCADNoResponse            = 3,                            /* remote not responding */
  292.     telCADRejected                = 4,                            /* call rejected */
  293.     telCADNumberChanged            = 5,                            /* number changed */
  294.     telCADInvalidDest            = 6,                            /* invalid destination address */
  295.     telCADFacilityRejected        = 7,                            /* requested facility rejected */
  296.     telCADUnobtainableDest        = 9,                            /* destination not obtainable */
  297.     telCADCongested                = 10,                            /* network congestion */
  298.     telCADIncompatibleDest        = 11,                            /* incompatible destination */
  299.     telCADTimeout                = 12,                            /* call timed out */
  300.     telCADUnknown                = 15,                            /* reason unknown */
  301. /* CONFERENCE MESSAGES */
  302.     telConferencePrepFailed        = 0,                            /* conference could not be prepared */
  303.     telConferencePending        = 1,                            /* conference prepared successfully */
  304.     telConferenceEstFailed        = 2,                            /* conference could not be established */
  305.     telConferenceEst            = 3,                            /* conference established */
  306. /* TRANSFER MESSAGES */
  307.     telTransferPrepFailed        = 0,                            /* transfer could not be prepared */
  308.     telTransferPending            = 1,                            /* transfer prepared successfully */
  309.     telTransferEst                = 2,                            /* consult or blind xfer successful */
  310.     telTransferFailed            = 3,                            /* consult or blind xfer failed */
  311.     telTransferred                = 4,                            /* message to originator of CA specifying 
  312.                                      * that call was transferred to rmtDN */
  313. /* HOLD MESSAGES */
  314.     telHoldCleared                = 0,
  315.     telHoldEst                    = 1,
  316.     telHoldFailed                = 2,
  317. /* RECEIVE DIGIT MESSAGES */
  318.     telDigitAudible                = 0,
  319.     telDigitNotAudible            = 1,
  320. /* CALL PARK MESSAGES */
  321.     telCallParkEst                = 1,                            /* call has been successfully parked */
  322.     telCallParkRetrieveEst        = 2,                            /* parked Call has been successfully retrieved */
  323.     telCallParkFailed            = 3,                            /* attempt to setup call park has failed */
  324.     telCallParkRetrieveFailed    = 4,                            /* attempt to retrieve parked call failed */
  325.     telCallParkRecall            = 5,                            /* call park has been recalled */
  326. /* CALL BACK MESSAGES */
  327.     telCallbackCleared            = 0,                            /* call back has been cleared */
  328.     telCallbackEst                = 1,                            /* call back has been established */
  329.     telCallbackNowAvail            = 2,                            /* call can be called back with TELCallBackNow */
  330. /* if CA is zero, else call IS calling back on CA */
  331.     telCallbackFailed            = 3,                            /* attempt to setup callback has failed */
  332.     telCallbackDesired            = 4,                            /* a user has called this terminal, received no 
  333.                                      * answer and desires this terminal to call it 
  334.                                      * back */
  335.     telCallbackDesiredCleared    = 5,                            /* call back for no answer no longer desired */
  336.     telCalledback                = 6,                            /* callback has occurred successfully */
  337. /* CALL REJECT MESSAGES */
  338.     telCallRejectFailed            = 0,                            /* attempt to reject call has failed */
  339.     telCallRejectEst            = 1,                            /* call successfully rejected */
  340.     telCallRejected                = 2,                            /* message to originator that call was rejected */
  341. /* CALL DEFLECT MESSAGES */
  342.     telCallDeflectFailed        = 0,                            /* attempt to deflect call has failed */
  343.     telCallDeflectEst            = 1,                            /* call successfully deflected */
  344.     telCallDeflectRecall        = 2,                            /* deflected call has been recalled */
  345.     telCallDeflected            = 3,                            /* message to originator that call was deflected 
  346.                                      * to rmtDN */
  347.     telAutoDeflectImmediate        = 4,                            /* a call was automatically deflected from this 
  348.                                      * terminal as a result of immediate call 
  349.                                      * forwarding */
  350.     telAutoDeflectBusy            = 5,                            /* a call was automatically deflected from this 
  351.                                      * terminal as a result of call forwarding on busy */
  352.     telAutoDeflectNoAnswer        = 6,                            /* a call was automatically deflected from this 
  353.                                      * terminal as a result of call forwarding on 
  354.                                      * no answer */
  355. /* CONFERENCE SPLIT MESSAGES */
  356.     telConferenceSplitFailed    = 0,                            /* CA could not be split */
  357.     telConferenceSplitEst        = 1,                            /* CA split successfully */
  358. /* CONFERENCE DROP MESSAGES */
  359.     telConferenceDropFailed        = 0,                            /* CA could not be dropped */
  360.     telConferenceDropped        = 1,                            /* CA dropped successfully */
  361. /* CALL PICKUP MESSAGES */
  362.     telCallPickupEst            = 0,                            /* call pickup was successful */
  363.     telCallPickupFailed            = 1,                            /* call pickup failed */
  364.     telCallPickedUp                = 2,                            /* message to originator that call was picked 
  365.                                      * up at a different DN */
  366. /* PAGING MESSAGES */
  367.     telPageEst                    = 0,                            /* paging was successful */
  368.     telPageComplete                = 1,                            /* paging activity completed */
  369.     telPageFailed                = 2,                            /* paging failed */
  370. /* INTERCOM MESSAGES */
  371.     telIntercomEst                = 0,                            /* intercom was successful */
  372.     telIntercomComplete            = 1,                            /* intercom activity completed */
  373.     telIntercomFailed            = 2,                            /* intercom failed */
  374. /* MODEM TONE MESSAGES */
  375.     telModemToneDetected        = 0,                            /* modem tone was detected */
  376.     telModemToneCleared            = 1,                            /* modem tone went away */
  377. /* FAX TONE MESSAGES */
  378.     telFaxToneDetected            = 0,                            /* fax tone was detected */
  379.     telFaxToneCleared            = 1,                            /* fax tone went away */
  380. /* IN USE MESSAGES */
  381.     telInUsePrivate                = 0,                            /* MADN is in use and can't be accessed */
  382.     telInUseCanAccess            = 1,                            /* MADN is in use, and others can access it 
  383.                                      * and join in */
  384.     telInUseCanMakePrivate        = 2,                            /* MADN is in use, but available for any one
  385.                                      * person to access */
  386.     telInUseCleared                = 3,                            /* MADN is no longer in use */
  387. /* CALL APPEARANCE STATES */
  388.     telCAIdleState                = 0,                            /* a call doesn't exist at this time */
  389.     telCAInUseState                = 1,                            /* the call is active but at another terminal */
  390.     telCAOfferState                = 2,                            /* a call is being offered to the terminal */
  391.     telCAQueuedState            = 3,                            /* a call is being queued at this terminal */
  392.     telCAAlertingState            = 4,                            /* a call is alerting at the terminal */
  393.     telCADialToneState            = 5,                            /* initiated outgoing call has dialtone */
  394.     telCADialingState            = 6,                            /* initiated outgoing call is dialing */
  395.     telCAWaitingState            = 7,                            /* initiated outgoing call is waiting for
  396.                                      * response from destination */
  397.     telCARingingState            = 8,                            /* the outgoing call is ringing. */
  398.     telCABusyState                = 9,                            /* destination is busy or can't be reached */
  399.     telCAHeldState                = 10,                            /* call has been put on hold by this terminal */
  400.     telCAConferencedState        = 11,                            /* this CA is part of a conference now */
  401.     telCAActiveState            = 12,                            /* the call is active and parties are free 
  402.                                      * to exchange data */
  403.     telCAReorderState            = 13,                            /* CA is in a reorder state */
  404.     telCAConferencedHeldState    = 14,                            /* CA is a conference call in a held state */
  405.     telCAUnknownState            = 15,                            /* the call state is unknown */
  406. /* TERMINAL MESSAGE EVENTMASKS */
  407.     telTermHookMsg                = 0x00000001,                    /* the hookswitch state has changed */
  408.     telTermKeyMsg                = 0x00000002,                    /* a phone pad key has been depressed */
  409.     telTermVolMsg                = 0x00000004,                    /* volume setting has changed */
  410.     telTermDisplayMsg            = 0x00000008,                    /* display has changed */
  411.     telTermEnableMsg            = 0x00000010,                    /* terminal has become enabled */
  412.     telTermOpenMsg                = 0x00000020,                    /* terminal has been opened */
  413.     telTermCloseMsg                = 0x00000040,                    /* terminal is shutting down */
  414.     telTermResetMsg                = 0x00000080,                    /* terminal has been reset */
  415.     telTermErrorMsg                = 0x00000100,                    /* hard equipment error */
  416.     telTermIndHSStateChgMsg        = 0x00000200,                    /* change in handset state from inacive to */
  417. /* active or vice versa */
  418.     telTermIndHSConnectMsg        = 0x00000400,                    /* independent handset connection has been changed */
  419.     telTermKeyImmMsg            = 0x00000800,                    /* immidiate arrival of phone pad key */
  420.     telTermVolStateMsg            = 0x00001000,                    /* volume state has changed */
  421.     telTermOtherMsg                = (long)0x80000000,                /* vendor defined error */
  422.     telAllTermMsgs                = 0x00001fff,                    /* mask to all non tool specific terminal events */
  423. /* DN MESSAGE EVENTMASK CONSTANTS */
  424.     telDNForwardMsg                = 0x00000001,                    /* forward feature activity */
  425.     telDNDNDMsg                    = 0x00000002,                    /* do not disturb feature activity */
  426.     telDNVoiceMailMsg            = 0x00000004,                    /* message has arrived for this DN */
  427.     telDNSelectedMsg            = 0x00000008,                    /* DN has been selected or deselected */
  428.     telDNOtherMsg                = (long)0x80000000,                /* a custom message for use by tools */
  429.     telAllDNMsgs                = 0x0000000f,                    /* mask to all non tool specific dn events */
  430. /* CA MESSAGE EVENTMASK CONSTANTS */
  431.     telCAAlertingMsg            = 0x00000001,                    /* CA is alerting  */
  432.     telCAOfferMsg                = 0x00000002,                    /* CA is being offered a call */
  433.     telCAProgressMsg            = 0x00000004,                    /* call progress info for this CA */
  434.     telCAOutgoingMsg            = 0x00000008,                    /* CA is initiating an outgoing call */
  435.     telCADisconnectMsg            = 0x00000010,                    /* CA disconnected (dropped or rmt disc */
  436.     telCAActiveMsg                = 0x00000020,                    /* CA is active and voice/data is free 
  437.                                              * to flow end to end */
  438.     telCAConferenceMsg            = 0x00000040,                    /* conference activity on CA */
  439.     telCATransferMsg            = 0x00000080,                    /* transfer feature activity */
  440.     telCAHoldMsg                = 0x00000100,                    /* hold feature activity */
  441.     telCADigitsMsg                = 0x00000200,                    /* remote signaling digits arrived */
  442.     telCACallParkMsg            = 0x00000400,                    /* CA call park feature activity */
  443.     telCACallbackMsg            = 0x00000800,                    /* CA call back feature activity  */
  444.     telCARejectMsg                = 0x00001000,                    /* CA is rejected */
  445.     telCADeflectMsg                = 0x00002000,                    /* CA is deflected */
  446.     telCAForwardMsg                = 0x00004000,                    /* CA is forwarded to this DN  */
  447.     telCAConferenceSplitMsg        = 0x00008000,                    /* conference split activity  */
  448.     telCAConferenceDropMsg        = 0x00010000,                    /* conference drop activity  */
  449.     telCAQueuedMsg                = 0x00020000,                    /* CA has been queued  */
  450.     telCAInUseMsg                = 0x00040000,                    /* CA is in use  */
  451.     telCACallPickupMsg            = 0x00080000,                    /* CA pickup activity */
  452.     telCAPagingMsg                = 0x00100000,                    /* CA paging activity */
  453.     telCAIntercomMsg            = 0x00200000,                    /* CA intercom activity */
  454.     telCAModemToneMsg            = 0x00400000,                    /* modem tones detected */
  455.     telCAFaxToneMsg                = 0x00800000,                    /* fax tones detected */
  456.     telCAIdleMsg                = 0x01000000,                    /* CA is in idle state */
  457.     telCASuccessiveAlertMsg        = 0x02000000,                    /* phone is alerting, one per ring */
  458.     telCAUserUserInfoMsg        = 0x04000000,                    /* user to user information has arrrived 
  459.                                              * for this CA */
  460.     telCAHandOffMsg                = 0x08000000,                    /* CA is ready for hand-off */
  461.     telCAVoiceDetectedMsg        = 0x10000000,                    /* voice Detect related event */
  462.     telCASilenceDetectedMsg        = 0x20000000,                    /* silence Detect related event */
  463.     telCADigitsImmMsg            = 0x40000000,                    /* immidiate arrival of remote signaling digits */
  464.     telCAOtherMsg                = (long)0x80000000,                /* tool specific CA message */
  465.     telAllCAMsgs                = 0x7fffffff                    /* mask to all non tool specific CA events */
  466. };
  467.  
  468. typedef OSErr TELErr;
  469.  
  470. typedef unsigned long TELFlags;
  471.  
  472.  
  473. enum {
  474.     telNoMenus                    = 1L << 16,                        /* tells tool not to display any custom menus */
  475.     telQuiet                    = 1L << 17,                        /* tells tool not to display any dialog boxes or alerts */
  476.     telConfigChanged            = 1L << 18                        /* notifies application that the config has changed */
  477. };
  478.  
  479. typedef unsigned long TELFeatureFlags;
  480.  
  481.  
  482. enum {
  483.     pcmAvail                    = 1L << 0,                        /* true if PCM voice data accessible */
  484.     hasHandset                    = 1L << 1,                        /* true if a phone handset is attached  */
  485.     hasSpeakerphone                = 1L << 2,                        /* true if a 2 way speakerphone is attached */
  486.     canOnHookDial                = 1L << 3,                        /* can on-hook dial */
  487.     hasRinger                    = 1L << 4,                        /* terminal has its own ringer */
  488.     canSetDisplay                = 1L << 5,                        /* application can write to the display */
  489.     hasKeypad                    = 1L << 6,                        /* attached phone has standard 12 key pad */
  490.     hasVideo                    = 1L << 7,                        /* terminal has a videophone */
  491.     hasOther                    = 1L << 8,                        /* reserved for future use */
  492.     crossDNConference            = 1L << 9,                        /* can perform cross-DN conferences */
  493.     hasSubaddress                = 1L << 10,                        /* attached network supports subaddressing */
  494.     hasUserUserInfo                = 1L << 11,                        /* network supports user-to-user info */
  495.     hasHandsetSoundStreams        = 1L << 12,                        /* sound streams are supported on the handset */
  496.     hasIndHandset                = 1L << 13,                        /* handset can be accessed independently of the phone line */
  497.     hasBuiltinSpeakerphone        = 1L << 14                        /* speaker and microphone of the Mac can be used */
  498. };
  499.  
  500. struct TELTermRecord {
  501.     short                            tRef;
  502.     TELFeatureFlags                    featureFlags;
  503.     short                            handsetSpeakerVol;
  504.     short                            handsetMicVol;
  505.     short                            speakerphoneVol;
  506.     short                            speakerphoneMicVol;
  507.     short                            ringerVol;
  508.     short                            otherVol;
  509.     short                            ringerTypes;
  510.     short                            hasDisplay;
  511.     short                            displayRows;
  512.     short                            numDNs;
  513.     short                            maxAllocCA;
  514.     short                            curAllocCA;
  515.     short                            builtinSpeakerVol;
  516.     short                            builtinSpeakerMicVol;
  517.     long                            reserved;
  518. };
  519. typedef struct TELTermRecord TELTermRecord;
  520.  
  521. typedef TELTermRecord *TELTermPtr;
  522.  
  523. struct TELRecord {
  524.     short                            procID;
  525.     TELFlags                        flags;
  526.     short                            reserved;
  527.     long                            refCon;
  528.     long                            userData;
  529.     UniversalProcPtr                defproc;
  530.     Ptr                                config;
  531.     Ptr                                oldConfig;
  532.     TELTermPtr                        pTELTerm;
  533.     long                            telPrivate;
  534.     long                            reserved1;
  535.     long                            reserved2;
  536.     long                            pTELTermSize;
  537.     short                            version;
  538. };
  539. typedef struct TELRecord TELRecord;
  540.  
  541. typedef TELRecord *TELPtr, **TELHandle;
  542.  
  543. typedef unsigned long TELDNFeatureFlags;
  544.  
  545.  
  546. enum {
  547.     dndSub                        = 1L << 0,                        /* do not disturb subscribed */
  548.     dndAvail                    = 1L << 1,                        /* do not disturb available */
  549.     dndActive                    = 1L << 2,                        /* do not disturb active */
  550.     voiceMailAccessSub            = 1L << 3,                        /* message waiting subscribed */
  551.     voiceMailAccessAvail        = 1L << 4,                        /* message waiting available */
  552.     voiceMailAccessActive        = 1L << 5,                        /* message waiting active */
  553.     pagingSub                    = 1L << 6,                        /* paging is subscribed */
  554.     pagingAvail                    = 1L << 7,                        /* paging is available */
  555.     pagingActive                = 1L << 8,                        /* paging is active */
  556.     intercomSub                    = 1L << 9,                        /* intercom is subscribed */
  557.     intercomAvail                = 1L << 10,                        /* intercom is available */
  558.     intercomActive                = 1L << 11,                        /* intercom is active */
  559.     dnSelectSub                    = 1L << 12,                        /* DN select is subscribed */
  560.     dnSelectAvail                = 1L << 13,                        /* DN select is available */
  561.     dnSelectActive                = 1L << 14,                        /* DN is selected */
  562.     callPickupSub                = 1L << 15,                        /* call pickup is subscribed */
  563.     callPickupAvail                = 1L << 16,                        /* call pickup is available */
  564.     dnInUse                        = 1L << 17,                        /* a CA is allocated for this DN */
  565.     logicalDN                    = 1L << 18,                        /* this DN is not on this terminal */
  566.     dnAccessible                = 1L << 19,                        /* commands can be sent to this DN */
  567.     canInitiate                    = 1L << 20,                        /* an outgoing CA can be initiated */
  568.     voiceMessageWaiting            = 1L << 21,                        /* voice mail waiting for this dn */
  569.     hasDNSoundStreams            = 1L << 22,                        /* sound streams are supported on this DN */
  570.     autoAnswerAvail                = 1L << 23,                        /* AutoAnswer is set for this DN */
  571.     autoAnswerActive            = 1L << 24,                        /* AutoAnswer is currently applied to CA on this DN */
  572.     tollSaverAvail                = 1L << 25,                        /* tollSaver is set for this DN */
  573.     tollSaverActive                = 1L << 26                        /* tollSaver is currently applied to CA on this DN */
  574. };
  575.  
  576. typedef unsigned long TELDNForwardFlags;
  577.  
  578.  
  579. enum {
  580.     immediateForwardSub            = 1L << 0,                        /* immediate call forward subscribed */
  581.     immediateForwardAvail        = 1L << 1,                        /* immediate call forward available */
  582.     immediateForwardActive        = 1L << 2,                        /* immediate call forward active */
  583.     busyForwardSub                = 1L << 3,                        /* forward on busy subscribed */
  584.     busyForwardAvail            = 1L << 4,                        /* forward on busy available */
  585.     busyForwardActive            = 1L << 5,                        /* forward on busy active */
  586.     noAnswerForwardSub            = 1L << 6,                        /* no answer call forward subscribed */
  587.     noAnswerForwardAvail        = 1L << 7,                        /* no answer call forward available */
  588.     noAnswerForwardActive        = 1L << 8,                        /* no answer call forward active */
  589.     busyNAForwardSub            = 1L << 9,                        /* busy & no answer call forward subscribed */
  590.     busyNAForwardAvail            = 1L << 10,                        /* busy & no answer call forward available */
  591.     busyNAForwardActive            = 1L << 11                        /* busy & no answer call forward active */
  592. };
  593.  
  594. struct TELDNRecord {
  595.     short                            dnRef;
  596.     StringPtr                        dn;
  597.     StringPtr                        dnPartyName;
  598.     StringPtr                        dnSubaddress;
  599.     TELHandle                        hTEL;
  600.     short                            maxAllocCA;
  601.     short                            curAllocCA;
  602.     short                            dnType;
  603.     TELDNFeatureFlags                featureFlags;
  604.     short                            numPageIDs;
  605.     short                            numIntercomIDs;
  606.     short                            numPickupIDs;
  607.     TELDNForwardFlags                forwardFlags;
  608.     StringPtr                        iForwardDN;
  609.     StringPtr                        iForwardSubaddress;
  610.     StringPtr                        iForwardPartyName;
  611.     StringPtr                        bForwardDN;
  612.     StringPtr                        bForwardSubaddress;
  613.     StringPtr                        bForwardPartyName;
  614.     StringPtr                        naForwardDN;
  615.     StringPtr                        naForwardSubaddress;
  616.     StringPtr                        naForwardPartyName;
  617.     short                            naForwardRings;
  618.     long                            telDNPrivate;
  619.     long                            refCon;
  620.     long                            userData;
  621.     long                            reserved;
  622. };
  623. typedef struct TELDNRecord TELDNRecord;
  624.  
  625. typedef TELDNRecord *TELDNPtr, **TELDNHandle;
  626.  
  627. typedef unsigned long TELCAFeatureFlags;
  628.  
  629.  
  630. enum {
  631.     holdSub                        = 1L << 0,                        /* hold subscribed  */
  632.     holdAvail                    = 1L << 1,                        /* hold available  */
  633.     holdActive                    = 1L << 2,                        /* hold active  */
  634.     conferenceSub                = 1L << 3,                        /* conference subscribed */
  635.     conferenceAvail                = 1L << 4,                        /* conference available */
  636.     conferenceActive            = 1L << 5,                        /* conference active  */
  637.     conferenceDropSub            = 1L << 6,                        /* conference drop subscribed  */
  638.     conferenceDropAvail            = 1L << 7,                        /* a call to TELDrop will drop this 
  639.                                          * CA only from a conference */
  640.     conferenceSplitSub            = 1L << 8,                        /* conference split subscribed  */
  641.     conferenceSplitAvail        = 1L << 9,                        /* conference split available for this CA */
  642.     numToConferenceRequired        = 1L << 10,                        /* the number of CAs to be conferenced is 
  643.                                          * required in TELConfPrep  */
  644.     transferSub                    = 1L << 11,                        /* transfer subscribed  */
  645.     transferAvail                = 1L << 12,                        /* transfer available  */
  646.     transferActive                = 1L << 13,                        /* transfer active */
  647.     caRelated                    = 1L << 14                        /* this CA is the specified in some 
  648.                                          * other CA's relatedCA field  */
  649. };
  650.  
  651. typedef unsigned long TELCAOtherFeatures;
  652.  
  653.  
  654. enum {
  655.     callbackSub                    = 1L << 0,                        /* call back subscribed */
  656.     callbackAvail                = 1L << 1,                        /* call back available */
  657.     callbackActive                = 1L << 2,                        /* call back active  */
  658.     callbackClearSub            = 1L << 3,                        /* call back clearing subscribed */
  659.     callbackNowSub                = 1L << 4,                        /* call back now subscribed */
  660.     callbackNowAvail            = 1L << 5,                        /* call back now available  */
  661.     callbackBusy                = 1L << 6,                        /* call back on busy */
  662.     callbackNoAnswer            = 1L << 7,                        /* call back on no answer */
  663.     callbackReturnsRef            = 1L << 8,                        /* call back returns a reference */
  664.     parkSub                        = 1L << 9,                        /* call park subscribed */
  665.     parkAvail                    = 1L << 10,                        /* call park available */
  666.     parkActive                    = 1L << 11,                        /* call park active */
  667.     parkRetrieveSub                = 1L << 12,                        /* call park retrieve subscribed */
  668.     parkRetrieveWithID            = 1L << 13,                        /* retrieve parked calls with IDs */
  669.     parkWithReturnedID            = 1L << 14,                        /* RESERVED */
  670.     parkWithGivenID                = 1L << 18,                        /* for switch that requires ID for parking */
  671.     rejectable                    = 1L << 15,                        /* CA is rejectable  */
  672.     deflectable                    = 1L << 16,                        /* CA is deflectable  */
  673.     acceptable                    = 1L << 17,                        /* CA is acceptable */
  674.     voiceDetected                = 1L << 19,                        /* voice has been detected on this CA incase of 
  675.                                                 an incoming call */
  676.     callAnswdTSRings            = 1L << 20,                        /* incoimng call was answered on TollSaver rings */
  677.     progressHasDuration            = 1L << 21                        /* If set then telCAProgress messages sent to the CA message handler
  678.                                            carry the duration in milliseconds in the mType parameter.  If the
  679.                                            mType is zero that duration is unknown. */
  680. };
  681.  
  682. typedef struct TELCARecord TELCARecord;
  683.  
  684. typedef TELCARecord *TELCAPtr, **TELCAHandle;
  685.  
  686. struct TELCARecord {
  687.     short                            caRef;
  688.     TELDNHandle                        hTELDN;
  689.     TELHandle                        hTEL;
  690.     short                            caState;
  691.     TELCAHandle                        relatedCA;
  692.     long                            connectTime;                /* can be used by application to keep track of connect time */
  693.     short                            intExt;
  694.     short                            callType;
  695.     short                            dialType;
  696.     short                            bearerType;
  697.     short                            rate;
  698.     StringPtr                        rmtDN;
  699.     StringPtr                        rmtPartyName;
  700.     StringPtr                        rmtSubaddress;
  701.     StringPtr                        routeDN;
  702.     StringPtr                        routePartyName;
  703.     StringPtr                        routeSubaddress;
  704.     short                            priority;
  705.     short                            conferenceLimit;
  706.     TELCAFeatureFlags                featureFlags;
  707.     TELCAOtherFeatures                otherFeatures;
  708.     long                            telCAPrivate;
  709.     long                            refCon;
  710.     long                            userData;
  711.     long                            reserved;
  712. };
  713. /* Constants for HandleType in structure above */
  714.  
  715. enum {
  716.     telHandleType                = 0,                            /* feature requires a terminal handle */
  717.     telDNHandleType                = 1,                            /* feature requires a DN handle */
  718.     telCAHandleType                = 2                                /* feature requires a CA handle */
  719. };
  720.  
  721. struct FeatureList {
  722.     short                            featureID;
  723.     StringPtr                        featureName;
  724.     short                            handleType;
  725.     struct FeatureList                *nextFeature;
  726. };
  727. typedef struct FeatureList FeatureList;
  728.  
  729. typedef FeatureList *FeatureListPtr;
  730.  
  731. /* CA MESSAGE STRUCTURES FOR MSGINFO */
  732. struct CAGenericMsgRec {
  733.     StringPtr                        rmtDN;
  734.     StringPtr                        rmtName;
  735.     StringPtr                        rmtSubaddress;
  736.     short                            dialType;
  737. };
  738. typedef struct CAGenericMsgRec CAGenericMsgRec;
  739.  
  740. struct CAUserUserInfoMsgRec {
  741.     StringPtr                        userUserInfo;
  742. };
  743. typedef struct CAUserUserInfoMsgRec CAUserUserInfoMsgRec;
  744.  
  745. struct CAConfMsgRec {
  746.     TELCAHandle                        relatedCA;
  747. };
  748. typedef struct CAConfMsgRec CAConfMsgRec;
  749.  
  750. struct CATransfMsgRec {
  751.     StringPtr                        rmtDN;
  752.     StringPtr                        rmtName;
  753.     StringPtr                        rmtSubaddress;
  754.     short                            dialType;
  755.     TELCAHandle                        prepCA;
  756. };
  757. typedef struct CATransfMsgRec CATransfMsgRec;
  758.  
  759. typedef pascal void (*TelephoneTermMsgProcPtr)(TELHandle hTEL, long msg, short mtype, short value, long globals);
  760. typedef pascal void (*TelephoneDNMsgProcPtr)(TELDNHandle hTELDN, long Msg, short mtype, short value, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress, long globals);
  761. typedef pascal void (*TelephoneCAMsgProcPtr)(TELCAHandle hTELCA, long Msg, short mtype, short value, Ptr Msginfo, long globals);
  762. typedef pascal void (*TelephoneChooseIdleProcPtr)(void);
  763.  
  764. #if GENERATINGCFM
  765. typedef UniversalProcPtr TelephoneTermMsgUPP;
  766. typedef UniversalProcPtr TelephoneDNMsgUPP;
  767. typedef UniversalProcPtr TelephoneCAMsgUPP;
  768. typedef UniversalProcPtr TelephoneChooseIdleUPP;
  769. #else
  770. typedef TelephoneTermMsgProcPtr TelephoneTermMsgUPP;
  771. typedef TelephoneDNMsgProcPtr TelephoneDNMsgUPP;
  772. typedef TelephoneCAMsgProcPtr TelephoneCAMsgUPP;
  773. typedef TelephoneChooseIdleProcPtr TelephoneChooseIdleUPP;
  774. #endif
  775.  
  776. enum {
  777.     uppTelephoneTermMsgProcInfo = kPascalStackBased
  778.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELHandle)))
  779.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  780.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  781.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  782.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(long))),
  783.     uppTelephoneDNMsgProcInfo = kPascalStackBased
  784.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELDNHandle)))
  785.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  786.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  787.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  788.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(ConstStr255Param)))
  789.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(ConstStr255Param)))
  790.          | STACK_ROUTINE_PARAMETER(7, SIZE_CODE(sizeof(ConstStr255Param)))
  791.          | STACK_ROUTINE_PARAMETER(8, SIZE_CODE(sizeof(long))),
  792.     uppTelephoneCAMsgProcInfo = kPascalStackBased
  793.          | STACK_ROUTINE_PARAMETER(1, SIZE_CODE(sizeof(TELCAHandle)))
  794.          | STACK_ROUTINE_PARAMETER(2, SIZE_CODE(sizeof(long)))
  795.          | STACK_ROUTINE_PARAMETER(3, SIZE_CODE(sizeof(short)))
  796.          | STACK_ROUTINE_PARAMETER(4, SIZE_CODE(sizeof(short)))
  797.          | STACK_ROUTINE_PARAMETER(5, SIZE_CODE(sizeof(Ptr)))
  798.          | STACK_ROUTINE_PARAMETER(6, SIZE_CODE(sizeof(long))),
  799.     uppTelephoneChooseIdleProcInfo = kPascalStackBased
  800. };
  801.  
  802. #if GENERATINGCFM
  803. #define NewTelephoneTermMsgProc(userRoutine)        \
  804.         (TelephoneTermMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneTermMsgProcInfo, GetCurrentArchitecture())
  805. #define NewTelephoneDNMsgProc(userRoutine)        \
  806.         (TelephoneDNMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneDNMsgProcInfo, GetCurrentArchitecture())
  807. #define NewTelephoneCAMsgProc(userRoutine)        \
  808.         (TelephoneCAMsgUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneCAMsgProcInfo, GetCurrentArchitecture())
  809. #define NewTelephoneChooseIdleProc(userRoutine)        \
  810.         (TelephoneChooseIdleUPP) NewRoutineDescriptor((ProcPtr)(userRoutine), uppTelephoneChooseIdleProcInfo, GetCurrentArchitecture())
  811. #else
  812. #define NewTelephoneTermMsgProc(userRoutine)        \
  813.         ((TelephoneTermMsgUPP) (userRoutine))
  814. #define NewTelephoneDNMsgProc(userRoutine)        \
  815.         ((TelephoneDNMsgUPP) (userRoutine))
  816. #define NewTelephoneCAMsgProc(userRoutine)        \
  817.         ((TelephoneCAMsgUPP) (userRoutine))
  818. #define NewTelephoneChooseIdleProc(userRoutine)        \
  819.         ((TelephoneChooseIdleUPP) (userRoutine))
  820. #endif
  821.  
  822. #if GENERATINGCFM
  823. #define CallTelephoneTermMsgProc(userRoutine, hTEL, msg, mtype, value, globals)        \
  824.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneTermMsgProcInfo, (hTEL), (msg), (mtype), (value), (globals))
  825. #define CallTelephoneDNMsgProc(userRoutine, hTELDN, Msg, mtype, value, rmtDN, rmtName, rmtSubaddress, globals)        \
  826.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneDNMsgProcInfo, (hTELDN), (Msg), (mtype), (value), (rmtDN), (rmtName), (rmtSubaddress), (globals))
  827. #define CallTelephoneCAMsgProc(userRoutine, hTELCA, Msg, mtype, value, Msginfo, globals)        \
  828.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneCAMsgProcInfo, (hTELCA), (Msg), (mtype), (value), (Msginfo), (globals))
  829. #define CallTelephoneChooseIdleProc(userRoutine)        \
  830.         CallUniversalProc((UniversalProcPtr)(userRoutine), uppTelephoneChooseIdleProcInfo)
  831. #else
  832. #define CallTelephoneTermMsgProc(userRoutine, hTEL, msg, mtype, value, globals)        \
  833.         (*(userRoutine))((hTEL), (msg), (mtype), (value), (globals))
  834. #define CallTelephoneDNMsgProc(userRoutine, hTELDN, Msg, mtype, value, rmtDN, rmtName, rmtSubaddress, globals)        \
  835.         (*(userRoutine))((hTELDN), (Msg), (mtype), (value), (rmtDN), (rmtName), (rmtSubaddress), (globals))
  836. #define CallTelephoneCAMsgProc(userRoutine, hTELCA, Msg, mtype, value, Msginfo, globals)        \
  837.         (*(userRoutine))((hTELCA), (Msg), (mtype), (value), (Msginfo), (globals))
  838. #define CallTelephoneChooseIdleProc(userRoutine)        \
  839.         (*(userRoutine))()
  840. #endif
  841.  
  842. extern pascal TELErr InitTEL(void);
  843. extern pascal TELErr TELGetInfo(TELHandle hTEL);
  844. extern pascal TELErr TELOpenTerm(TELHandle hTEL);
  845. extern pascal TELErr TELResetTerm(TELHandle hTEL);
  846. extern pascal TELErr TELCloseTerm(TELHandle hTEL);
  847. extern pascal TELErr TELTermMsgHand(TELHandle hTEL, long eventMask, TelephoneTermMsgUPP msgProc, long globals);
  848. extern pascal TELErr TELClrTermMsgHand(TELHandle hTEL, TelephoneTermMsgUPP msgProc);
  849. extern pascal TELErr TELTermEventsSupp(TELHandle hTEL, long *eventMask);
  850. extern pascal short TELGetProcID(Str255 name);
  851. extern pascal TELHandle TELNew(short procID, TELFlags flags, long refCon, long userData);
  852. extern pascal TELHandle TELNewWithResult(short procID, TELFlags flags, long refCon, long userData, TELErr *error);
  853. extern pascal TELErr TELDefault(Ptr *theConfig, short procID, Boolean allocate);
  854. extern pascal Boolean TELValidate(TELHandle hTEL);
  855. extern pascal Ptr TELGetConfig(TELHandle hTEL);
  856. extern pascal short TELSetConfig(TELHandle hTEL, Ptr thePtr);
  857. extern pascal TELErr TELChoose(TELHandle *hTEL, Point where, TelephoneChooseIdleUPP idleProc);
  858. extern pascal Handle TELSetupPreflight(short procID, long *magicCookie);
  859. extern pascal void TELSetupSetup(short procID, Ptr theConfig, short count, DialogPtr theDialog, long *magicCookie);
  860. extern pascal Boolean TELSetupFilter(short procID, Ptr theConfig, short count, DialogPtr theDialog, EventRecord *theEvent, short *theItem, long *magicCookie);
  861. extern pascal void TELSetupItem(short procID, Ptr theConfig, short count, DialogPtr theDialog, short *theItem, long *magicCookie);
  862. extern pascal void TELSetupCleanup(short procID, Ptr theConfig, short count, DialogPtr theDialog, long *magicCookie);
  863. extern pascal void TELSetupXCleanup(short procID, Ptr theConfig, short count, DialogPtr theDialog, Boolean OKed, long *magicCookie);
  864. extern pascal void TELSetupPostflight(short procID);
  865. extern pascal TELErr TELDispose(TELHandle hTEL);
  866. extern pascal short TELCountDNs(TELHandle hTEL, short dnType, Boolean physical);
  867. extern pascal TELErr TELDNLookupByIndex(TELHandle hTEL, short dnType, Boolean physical, short index, TELDNHandle *hTELDN);
  868. extern pascal TELErr TELDNLookupByName(TELHandle hTEL, ConstStr255Param DN, TELDNHandle *hTELDN);
  869. extern pascal TELErr TELDNSelect(TELDNHandle hTELDN, Boolean select);
  870. extern pascal TELErr TELDNDispose(TELDNHandle hTELDN);
  871. extern pascal TELErr TELGetDNInfo(TELDNHandle hTELDN);
  872. extern pascal TELErr TELGetDNFlags(TELDNHandle hTELDN, long *dnFeatureFlags, long *dnForwardFlags);
  873. extern pascal TELErr TELDNMsgHand(TELDNHandle hTELDN, Boolean allDNs, long eventMask, TelephoneDNMsgUPP msgProc, long globals);
  874. extern pascal TELErr TELClrDNMsgHand(TELDNHandle hTELDN, TelephoneDNMsgUPP msgProc);
  875. extern pascal TELErr TELDNEventsSupp(TELDNHandle hTELDN, long *eventMask);
  876. extern pascal short TELCountCAs(TELDNHandle hTELDN, short internalExternal);
  877. extern pascal TELErr TELCALookup(TELDNHandle hTELDN, short internalExternal, short index, TELCAHandle *hTELCA);
  878. extern pascal TELErr TELCADispose(TELCAHandle hTELCA);
  879. extern pascal TELErr TELGetCAState(TELCAHandle hTELCA, short *state);
  880. extern pascal TELErr TELGetCAFlags(TELCAHandle hTELCA, long *caFeatureFlags, long *caOtherFeatures);
  881. extern pascal TELErr TELGetCAInfo(TELCAHandle hTELCA);
  882. extern pascal TELErr TELCAMsgHand(TELDNHandle hTELDN, long eventMask, TelephoneCAMsgUPP msgProc, long globals);
  883. extern pascal TELErr TELClrCAMsgHand(TELDNHandle hTELDN, TelephoneCAMsgUPP msgProc);
  884. extern pascal TELErr TELCAEventsSupp(TELDNHandle hTELDN, long *eventMask);
  885. extern pascal TELErr TELSetupCall(TELDNHandle hTELDN, TELCAHandle *hTELCA, ConstStr255Param destDN, ConstStr255Param destName, ConstStr255Param destSubaddress, ConstStr255Param userUserInfo, short bearerType, short rate);
  886. extern pascal TELErr TELConnect(TELCAHandle hTELCA);
  887. extern pascal TELErr TELDialDigits(TELCAHandle hTELCA, ConstStr255Param digits);
  888. extern pascal TELErr TELAcceptCall(TELCAHandle hTELCA);
  889. extern pascal TELErr TELRejectCall(TELCAHandle hTELCA, short reason);
  890. extern pascal TELErr TELDeflectCall(TELCAHandle hTELCA, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress);
  891. extern pascal TELErr TELAnswerCall(TELCAHandle hTELCA);
  892. extern pascal TELErr TELDrop(TELCAHandle hTELCA, ConstStr255Param userUserInfo);
  893. extern pascal TELErr TELHold(TELCAHandle hTELCA);
  894. extern pascal TELErr TELRetrieve(TELCAHandle hTELCA);
  895. extern pascal TELErr TELConferencePrep(TELCAHandle hTELCA1, TELCAHandle hTELCA2, short numToConference);
  896. extern pascal TELErr TELConferenceEstablish(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  897. extern pascal TELErr TELConferenceSplit(TELCAHandle hTELCA);
  898. extern pascal TELErr TELTransferPrep(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  899. extern pascal TELErr TELTransferEstablish(TELCAHandle hTELCA1, TELCAHandle hTELCA2);
  900. extern pascal TELErr TELTransferBlind(TELCAHandle hTELCA, ConstStr255Param rmtDN, ConstStr255Param rmtName, ConstStr255Param rmtSubaddress);
  901. extern pascal TELErr TELForwardSet(TELDNHandle hTELDN, ConstStr255Param forwardDN, ConstStr255Param forwardName, ConstStr255Param forwardSubaddress, short forwardType, short numrings);
  902. extern pascal TELErr TELForwardClear(TELDNHandle hTELDN, short forwardType);
  903. extern pascal TELErr TELCallbackSet(TELCAHandle hTELCA, short *callbackRef);
  904. extern pascal TELErr TELCallbackClear(TELHandle hTEL, short callbackRef);
  905. extern pascal TELErr TELCallbackNow(TELCAHandle hTELCA, short callbackRef);
  906. extern pascal TELErr TELDNDSet(TELDNHandle hTELDN, short dndType);
  907. extern pascal TELErr TELDNDClear(TELDNHandle hTELDN, short dndType);
  908. extern pascal TELErr TELCallPickup(TELCAHandle hTELCA, ConstStr255Param pickupDN, short pickupGroupID);
  909. extern pascal TELErr TELParkCall(TELCAHandle hTELCA, StringPtr *parkRetrieveID, ConstStr255Param parkID);
  910. extern pascal TELErr TELRetrieveParkedCall(TELCAHandle hTELCA, ConstStr255Param parkRetrieveID);
  911. extern pascal TELErr TELVoiceMailAccess(TELCAHandle hTELCA);
  912. extern pascal TELErr TELPaging(TELCAHandle hTELCA, short pageID);
  913. extern pascal TELErr TELIntercom(TELCAHandle hTELCA, short intercomID);
  914. extern pascal TELErr TELOtherFeatureList(TELHandle hTEL, FeatureListPtr *fList);
  915. extern pascal TELErr TELOtherFeatureImplement(TELHandle hTEL, Handle theHandle, short featureID);
  916. extern pascal TELErr TELToolFunctions(TELHandle hTEL, short msgcode, Boolean *supportsIt);
  917. extern pascal TELErr TELOtherFunction(TELHandle hTEL, Ptr paramblock, long size);
  918. extern pascal TELErr TELGetHooksw(TELHandle hTEL, short hookType, Boolean *offHook);
  919. extern pascal TELErr TELSetHooksw(TELHandle hTEL, short hookType, Boolean offHook);
  920. extern pascal TELErr TELGetVolume(TELHandle hTEL, short volType, short *level, short *volState);
  921. extern pascal TELErr TELSetVolume(TELHandle hTEL, short volType, short *level, short volState);
  922. extern pascal TELErr TELAlert(TELHandle hTEL, short *level, short alertPattern);
  923. extern pascal TELErr TELGetDisplay(TELHandle hTEL, short index, short *displayMode, StringPtr *text);
  924. extern pascal TELErr TELSetDisplay(TELHandle hTEL, short index, short displayMode, ConstStr255Param text);
  925. extern pascal void TELIdle(TELHandle hTEL);
  926. extern pascal void TELActivate(TELHandle hTEL, Boolean activate);
  927. extern pascal void TELResume(TELHandle hTEL, Boolean resume);
  928. extern pascal Boolean TELMenu(TELHandle hTEL, short menuID, short item);
  929. extern pascal void TELEvent(TELHandle hTEL, const EventRecord *theEvent);
  930. extern pascal void TELGetToolName(short procID, Str255 name);
  931. extern pascal Handle TELGetVersion(TELHandle hTEL);
  932. extern pascal short TELGetTELVersion(void);
  933. extern pascal TELErr TELIntlToEnglish(TELHandle hTEL, Ptr inputPtr, Ptr *outputPtr, short language);
  934. extern pascal TELErr TELEnglishToIntl(TELHandle hTEL, Ptr inputPtr, Ptr *outputPtr, short language);
  935. extern pascal TELErr TELGetDNSoundInput(TELDNHandle hTELDN, Str255 deviceName);
  936. extern pascal TELErr TELDisposeDNSoundInput(TELDNHandle hTELDN, ConstStr255Param deviceName);
  937. extern pascal TELErr TELGetDNSoundOutput(TELDNHandle hTELDN, Component *SndOut);
  938. extern pascal TELErr TELDisposeDNSoundOutput(TELDNHandle hTELDN, Component SndOut);
  939. extern pascal TELErr TELGetHSSoundInput(TELHandle termHand, Str255 deviceName);
  940. extern pascal TELErr TELDisposeHSSoundInput(TELHandle termHand, ConstStr255Param deviceName);
  941. extern pascal TELErr TELGetHSSoundOutput(TELHandle termHand, Component *SndOut);
  942. extern pascal TELErr TELDisposeHSSoundOutput(TELHandle termHand, Component SndOut);
  943. extern pascal TELErr TELDNSetAutoAnswer(TELDNHandle hTELDN, Boolean AutoAnswerOn);
  944. extern pascal TELErr TELDNTollSaverControl(TELDNHandle hTELDN, Boolean QuickAnswer);
  945. extern pascal TELErr TELSetIndHSConnect(TELHandle termHand, Boolean Connect);
  946. extern pascal TELErr TELGetIndHSConnect(TELHandle termHand, Boolean *Connect);
  947. extern pascal TELErr TELCAVoiceDetect(TELCAHandle hTELCA, Boolean VoiceDetectOn);
  948. extern pascal TELErr TELCASilenceDetect(TELCAHandle hTELCA, Boolean DetectOn, long Period);
  949. extern pascal TELErr TELGetTelNewErr(void);
  950. extern pascal TELErr TELDNSetDTMF(TELDNHandle hTELDN, Boolean dtmfOn);
  951. extern pascal TELErr TELDNGetDTMF(TELDNHandle hTELDN, Boolean *dtmfOn);
  952. extern pascal TELErr TELHSSetDTMF(TELHandle termHand, Boolean dtmfOn);
  953. extern pascal TELErr TELHSGetDTMF(TELHandle termHand, Boolean *dtmfOn);
  954. extern pascal TELErr TELGetDNStatus(TELDNHandle hTELDN, long *inUse);
  955. extern pascal TELErr TELGetDNProgressDet(TELDNHandle hTELDN, long selector, Boolean *prgDetOn);
  956. extern pascal TELErr TELSetDNProgressDet(TELDNHandle hTELDN, long selector, Boolean prgDetOn);
  957.  
  958. #ifdef __CFM68K__
  959. #pragma import off
  960. #endif
  961.  
  962. #if GENERATINGPOWERPC
  963. #pragma options align=reset
  964. #endif
  965.  
  966. #ifdef __cplusplus
  967. }
  968. #endif
  969.  
  970. #endif /* __TELEPHONES__ */
  971.